import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router';
import routes from '~pages';
import SearchResults from '@/pages/SearchResults.vue'; // 假设你的搜索结果页面组件路径

const customRoutes = [
  ...routes,
  {
    path: '/detail/:id',
    component: () => import('../pages/Detail.vue') // 使用相对路径
  },
  {
    path: '/search',

    component: () => import('../pages/SearchResults.vue') ,// 使用相对路径
     props: true ,
  },
];

const router = createRouter({
  routes: customRoutes,
  history: createWebHistory()
});

export default router;
